<?php

namespace App\Models;

use App\Observers\Contract\ObserverCleanable;
use App\Observers\OSSCleanObserver;
use App\Services\Utils\OSSable;
use Illuminate\Database\Eloquent\Model;

class SkinRunRecords extends Model implements ObserverCleanable
{
    use OSSable;
    //关联的表单
    protected $table = "skinrun_records";
    // 设为所有的字段不受保护
    protected  $guarded = [];

    /**
     * @return array
     */
    public function keyCleanColumns(): array
    {
        return ['image'];
    }

    /**
     * 注册删除 bosKey 事件绑定
     */
    protected static function boot()
    {
        parent::boot();

        /**
         * 监听bos清理事件
         */
        self::observe(OSSCleanObserver::class);
    }
}
